<template>
  <div class="cite-container">
    <div class="top-header">
        <header-top :isout="!ifShowBreadCrumb"></header-top>
    </div>
    <div class="view-page-content">
      <h5 class="show-title-text" v-if="ifShowBreadCrumb">
          <span class="back-text" @click="goBack()">首页 </span> > {{name}} 
      </h5>
      <!-- 路由视图 -->
      <router-view />
    </div>
    <footer class="footer-bottom">
      CopyRight?远东宏信 All right reserved
    </footer>
  </div>
</template>
<script>
import headerTop from "@/components/public/headerTop";
export default {
  name: "Cite",
  components: {
    "header-top":headerTop
  },
  data(){
    return {
      name:this.$route.meta.title,
      ifShowBreadCrumb: true,
      notBreadCrumb: ["/menu"],
    }
  },
  mounted() {
    if (this.notBreadCrumb.includes(this.$route.fullPath)) {
      this.ifShowBreadCrumb = false;
    }
  },
  methods:{
    goBack(){
      history.go(-1);
    }
  },
  watch: {
    //监听路由变化
    $route(to, from) {
      this.name = to.meta.title;
      if (this.notBreadCrumb.includes(to.fullPath)) {
        this.ifShowBreadCrumb = false;
      } else {
        this.ifShowBreadCrumb = true;
      }
    }
  }
};
</script>
<style lang="less">
@import url("./less/cite.less");
</style>